package com.dai.zhenfujin.message;

import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.dai.zhenfujin.R;
import com.dai.zhenfujin.base.BaseFragment;
import com.dai.zhenfujin.message.adapter.MessageFragmentAdapter;
import com.dai.zhenfujin.message.bean.MessageBean;

import java.util.ArrayList;
import java.util.List;

public class MessageFragment extends BaseFragment{
    private View view;
    private TextView tvTitle,tvSearch;
    private ImageView imageView;
    private ListView listView;

    private List<MessageBean> beans;
    private MessageFragmentAdapter adapter;
    @Override
    public View initView() {
        view = View.inflate(mContext, R.layout.fragment_message,null);
        tvTitle = view.findViewById(R.id.title_textview);
        tvTitle.setText("消息");
        imageView = view.findViewById(R.id.title_imageview);
        imageView.setVisibility(View.GONE);
        listView = view.findViewById(R.id.message_listview);
        tvSearch= view.findViewById(R.id.message_search);
        return view;
    }

    @Override
    public void initData() {
        super.initData();

        beans = new ArrayList<>();
        for (int i = 0; i <10 ; i++) {
            beans.add(new MessageBean("001","首席运营官","黄金甲"));
        }

        adapter = new MessageFragmentAdapter(mContext,beans);
        listView.setAdapter(adapter);
    }
}
